<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>class类</title>
  </head>
  <body>
    <script>
      class User {
        #url = "houdunren.com";
        constructor(name) {
          this.name = name;
        }

        set url(url) {
          this.#url = url;
        }
        get url() {
          return this.#url;
        }
      }
      let hd = new User("后盾人");
      console.log(hd.name, hd.url);
    </script>
  </body>
</html>
